fn generate_fibonacci(num: u32) -> Vec<u32> {
    let mut fib_sequence = Vec::new();
    let (mut a, mut b) = (0, 1);

    while b <= num {
        fib_sequence.push(b);
        let next = a + b;
        a = b;
        b = next;
    }

    fib_sequence
}

pub fn odd_fibnacci_sum(threshold: u32) -> u32 {
    let fib_sequence = generate_fibonacci(threshold);
    fib_sequence.iter().filter(|x| *x % 2 != 0).sum()
}
